package cn.tedu.goods.management.dao.persist.repository.impl;


import cn.tedu.goods.management.dao.persist.mapper.GoodsMapper;
import cn.tedu.goods.management.dao.persist.repository.IGoodsRepository;
import cn.tedu.goods.management.pojo.eneity.Goods;
import cn.tedu.goods.management.pojo.vo.GoodsListForUserVO;
import cn.tedu.goods.management.pojo.vo.GoodsListItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class GoodsRepositoryImpl implements IGoodsRepository {
    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public List<GoodsListItemVO> selectGoodsList() {
        return goodsMapper.selectGoodsList();
    }

    @Override
    public List<GoodsListForUserVO> selectGoodsListForUser() {
        return goodsMapper.selectGoodsListForUser();
    }

    @Override
    public Goods selectById(Long id) {
        return goodsMapper.selectById(id);
    }

    @Override
    public int avatar(Goods goods) {
        return goodsMapper.avatar(goods);
    }

    @Override
    public int updateById(Goods goods) {
        return goodsMapper.updateById(goods);
    }

    @Override
    public int delete(Long id) {
        return goodsMapper.deleteById(id);
    }

    @Override
    public int insert(Goods goods) {
        return goodsMapper.insert(goods);
    }
}
